import axios from 'axios'
import * as actionTypes from './actionTypes'

const changeLoginStautsAction = () => ({
    type: actionTypes.CHANGE_LOGIN_STATUS,
    login: false
});

export const changeLogin = (acount, passWord) => {
    return (dispatch) =>{
        axios.get('/api/login.json?acount='+acount+'&passWord='+passWord).then((res)=>{
            alert('登陆成功')
            dispatch(changeLoginStautsAction())
        }).catch(()=>{
            console.log('登陆失败')
        })
    }
};